//
//  AdaptHeigth.m
//  iNews
//
//  Created by lanou3g on 14-12-4.
//  Copyright (c) 2014年 张在青. All rights reserved.
//

#import "AdaptHeigth.h"

@implementation AdaptHeigth



//根据文本自适应label高度的方法,字体大小17;
+ (CGFloat)textHeigth:(NSString *)aString
{
    NSDictionary *dic = @{NSFontAttributeName: [UIFont systemFontOfSize:17]};
    CGRect textRect = [aString boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
   
    return textRect.size.height;
}

+ (CGFloat)heigthOfString:(NSString *)str
{
    NSLog(@"%@",str);
    NSDictionary *dic = @{NSFontAttributeName: [UIFont systemFontOfSize:14]};
    CGRect textRect = [str boundingRectWithSize:CGSizeMake(200, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    NSLog(@"11111111:%f",textRect.size.height);
    return textRect.size.height;

}


@end
